/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "REQUEST_QUEUE_HIST", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RequestQueueHist.getCpNumbers", query = "SELECT DISTINCT r.cpNumber FROM RequestQueueHist r ORDER BY r.cpNumber ASC"),
    @NamedQuery(name = "RequestQueueHist.getServiceNames", query = "SELECT DISTINCT r.serviceName FROM RequestQueueHist r ORDER BY r.serviceName ASC"),
    @NamedQuery(name = "RequestQueueHist.getDeliverProviders", query = "SELECT DISTINCT r.deliverProvider FROM RequestQueue r ORDER BY r.deliverProvider ASC"),
    @NamedQuery(name = "RequestQueueHist.findAll", query = "SELECT r FROM RequestQueueHist r"),
    @NamedQuery(name = "RequestQueueHist.findByRequestId", query = "SELECT r FROM RequestQueueHist r WHERE r.requestId = :requestId"),
    @NamedQuery(name = "RequestQueueHist.findByRequestDetail", query = "SELECT r FROM RequestQueueHist r WHERE r.requestDetail = :requestDetail"),
    @NamedQuery(name = "RequestQueueHist.findByParam", query = "SELECT r FROM RequestQueueHist r WHERE r.param = :param"),
    @NamedQuery(name = "RequestQueueHist.findByReceivedTime", query = "SELECT r FROM RequestQueueHist r WHERE r.receivedTime = :receivedTime"),
    @NamedQuery(name = "RequestQueueHist.findByMsisdn", query = "SELECT r FROM RequestQueueHist r WHERE r.msisdn = :msisdn ORDER BY r.receivedTime DESC"),
    @NamedQuery(name = "RequestQueueHist.findByMsisdnInDateRange", query = "SELECT r FROM RequestQueueHist r WHERE (r.receivedTime BETWEEN :startDate AND :endDate) AND r.msisdn LIKE :msisdn"),
    @NamedQuery(name = "RequestQueueHist.findByMsisdnBeforeStartDate", query = "SELECT r FROM RequestQueueHist r WHERE r.receivedTime >= :startDate AND r.msisdn LIKE :msisdn"),
    @NamedQuery(name = "RequestQueueHist.findByCpNumber", query = "SELECT r FROM RequestQueueHist r WHERE r.cpNumber = :cpNumber"),
    @NamedQuery(name = "RequestQueueHist.findByServiceName", query = "SELECT r FROM RequestQueueHist r WHERE r.serviceName = :serviceName"),
    @NamedQuery(name = "RequestQueueHist.findByStatus", query = "SELECT r FROM RequestQueueHist r WHERE r.status = :status"),
    @NamedQuery(name = "RequestQueueHist.findByLastCheckTime", query = "SELECT r FROM RequestQueueHist r WHERE r.lastCheckTime = :lastCheckTime"),
    @NamedQuery(name = "RequestQueueHist.findByCallBack", query = "SELECT r FROM RequestQueueHist r WHERE r.callBack = :callBack"),
    @NamedQuery(name = "RequestQueueHist.findByDeliverProvider", query = "SELECT r FROM RequestQueueHist r WHERE r.deliverProvider = :deliverProvider"),
    @NamedQuery(name = "RequestQueueHist.findByResponseContent", query = "SELECT r FROM RequestQueueHist r WHERE r.responseContent = :responseContent")})
public class RequestQueueHist implements Serializable {

    @Column(name = "SELECTED")
    private BigInteger selected;
    @Size(max = 160)
    @Column(name = "OLD_CONTENT")
    private String oldContent;
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "REQUEST_ID")
    private BigDecimal requestId;
    @Size(max = 400)
    @Column(name = "REQUEST_DETAIL")
    private String requestDetail;
    @Size(max = 400)
    @Column(name = "PARAM")
    private String param;
    @Column(name = "RECEIVED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date receivedTime;
    @Size(max = 20)
    @Column(name = "MSISDN")
    private String msisdn;
    @Size(max = 10)
    @Column(name = "CP_NUMBER")
    private String cpNumber;
    @Size(max = 40)
    @Column(name = "SERVICE_NAME")
    private String serviceName;
    @Size(max = 40)
    @Column(name = "STATUS")
    private String status;
    @Column(name = "LAST_CHECK_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastCheckTime;
    @Size(max = 200)
    @Column(name = "CALL_BACK")
    private String callBack;
    @Size(max = 200)
    @Column(name = "DELIVER_PROVIDER")
    private String deliverProvider;
    @Size(max = 400)
    @Column(name = "RESPONSE_CONTENT")
    private String responseContent;

    public RequestQueueHist() {
    }

    public RequestQueueHist(BigDecimal requestId) {
        this.requestId = requestId;
    }

    public BigDecimal getRequestId() {
        return requestId;
    }

    public void setRequestId(BigDecimal requestId) {
        this.requestId = requestId;
    }

    public String getRequestDetail() {
        return requestDetail;
    }

    public void setRequestDetail(String requestDetail) {
        this.requestDetail = requestDetail;
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }

    public Date getReceivedTime() {
        return receivedTime;
    }

    public void setReceivedTime(Date receivedTime) {
        this.receivedTime = receivedTime;
    }

    public String getMsisdn() {
        return msisdn;
    }

    public void setMsisdn(String msisdn) {
        this.msisdn = msisdn;
    }

    public String getCpNumber() {
        return cpNumber;
    }

    public void setCpNumber(String cpNumber) {
        this.cpNumber = cpNumber;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getLastCheckTime() {
        return lastCheckTime;
    }

    public void setLastCheckTime(Date lastCheckTime) {
        this.lastCheckTime = lastCheckTime;
    }

    public String getCallBack() {
        return callBack;
    }

    public void setCallBack(String callBack) {
        this.callBack = callBack;
    }

    public String getDeliverProvider() {
        return deliverProvider;
    }

    public void setDeliverProvider(String deliverProvider) {
        this.deliverProvider = deliverProvider;
    }

    public String getResponseContent() {
        return responseContent;
    }

    public void setResponseContent(String responseContent) {
        this.responseContent = responseContent;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (requestId != null ? requestId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RequestQueueHist)) {
            return false;
        }
        RequestQueueHist other = (RequestQueueHist) object;
        if ((this.requestId == null && other.requestId != null) || (this.requestId != null && !this.requestId.equals(other.requestId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.RequestQueueHist[ requestId=" + requestId + " ]";
    }

    public BigInteger getSelected() {
        return selected;
    }

    public void setSelected(BigInteger selected) {
        this.selected = selected;
    }

    public String getOldContent() {
        return oldContent;
    }

    public void setOldContent(String oldContent) {
        this.oldContent = oldContent;
    }
}
